﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="checkin.aspx.cs"
    Inherits="Site.Report.checkin" %>
<%@ Register TagPrefix="uc1" TagName="productSearch" Src="../UserControls/productSearch.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>checkIn</title>
		<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<LINK rel="stylesheet" type="text/css" href="/style/css.css">
        <script type="text/javascript">
            var btnDisabled = function () {
                var btn5 = document.getElementById('Button5');
                btn5.disabled = true;
                window.setTimeout(function () { document.forms[0].submit(); }, 1000);
            }
        </script>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server" >
			<FONT face="宋体">
				<TABLE id="Table1" border="0" cellSpacing="1" cellPadding="1" width="100%">
					<TR>
						<TD class="title" bgColor="#ffffff" align="center">验收入库单管理</TD>
					</TR>
					<TR>
						<TD align="right"><asp:button id="btnInDb" runat="server" CssClass="button2" 
                                Text="入库" onclick="btnInDb_Click"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<asp:button id="Button4" runat="server" CssClass="button2" Text="入库列表"></asp:button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<HR>
						</TD>
					</TR>
					<TR>
						<TD>
							<TABLE id="Table2" border="0" cellSpacing="0" cellPadding="0" width="100%">
								<TR>
									<TD align="right">类型：</TD>
									<TD><asp:dropdownlist id="drpType" runat="server" AutoPostBack="True" Width="152px" DataTextField="name"
											DataValueField="code"></asp:dropdownlist></TD>
									<TD align="right">供货单位：</TD>
									<TD><asp:textbox id="tbApplyDep" runat="server"></asp:textbox></TD>
									<TD align="right">工程备料：</TD>
									<TD><asp:textbox id="tbProjectReady" runat="server" Width="113px"></asp:textbox></TD>
									<TD align="right">摘&nbsp; 要：
									</TD>
									<TD><asp:textbox id="tbAbstract" runat="server"></asp:textbox></TD>
								</TR>
								<TR>
									<TD align="right">制单日期：</TD>
									<TD><asp:textbox id="tbdate" runat="server" Width="72px"></asp:textbox><asp:button id="Button3" runat="server" CssClass="button2" Text="自动单号"></asp:button></TD>
									<TD align="right">单&nbsp;&nbsp;&nbsp; 号：</TD>
									<TD><asp:textbox id="tbbillNumber" runat="server" Width="117px"></asp:textbox><asp:button id="Button2" runat="server" CssClass="button2" Text="查询"></asp:button></TD>
									<TD align="right">购买人：</TD>
									<TD><asp:textbox id="tbBuyer" runat="server" Width="72px"></asp:textbox></TD>
									<TD align="right"><asp:button id="Button6" runat="server" CssClass="button2" Text="修改名称"></asp:button></TD>
									<TD></TD>
								</TR>
							</TABLE>
							<hr>
						</TD>
					</TR>
					<TR>
						<TD>
							<TABLE id="Table3" border="0" cellSpacing="0" cellPadding="0" width="100%">
								<TR>
									<TD style="HEIGHT: 23px" colSpan="4" align="right"><uc1:productsearch id="ProductSearch1" runat="server"></uc1:productsearch></TD>
									<TD style="HEIGHT: 23px" align="right">应收数量：
									</TD>
									<TD style="HEIGHT: 23px"><asp:textbox id="tbShouldAmount" runat="server" Width="98px"></asp:textbox></TD>
									<TD style="HEIGHT: 23px" align="right">实收数量：</TD>
									<TD style="HEIGHT: 23px"><asp:textbox id="tbfactamount" runat="server" Width="98px" onchange="changeMe()"></asp:textbox></TD>
								</TR>
								<TR>
									<TD align="right">实际单价：</TD>
									<TD><asp:textbox id="tbfactunit" runat="server" Width="98px" onchange="changeMe()"></asp:textbox></TD>
									<TD align="right">实际金额：</TD>
									<TD><asp:textbox id="tbfactMoney" runat="server" Width="98px"></asp:textbox></TD>
									<TD align="right">备注：</TD>
									<TD><asp:textbox id="tbMemo" runat="server" Width="98px" MaxLength="50"></asp:textbox></TD>
									<TD align="right"><asp:button id="Button1" runat="server" CssClass="button2" Text="提交"></asp:button></TD>
								</TR>
							</TABLE>
							<HR>
						</TD>
					</TR>
					<TR>
						<TD>

                        <asp:GridView ID="gv" Visible=false runat="server" Width="100%" DataKeyNames="thisid"  ShowFooter=true AutoGenerateColumns=false>
                          <Columns>
                          <asp:BoundField   ReadOnly="true"  HeaderText="序号" />
                          <asp:BoundField   DataField="number"  HeaderText="编号" FooterText="合计" />
                          <asp:BoundField   DataField="productname"  HeaderText="名称规格"  />
                          <asp:BoundField   DataField="shouldamount"  HeaderText="应收数量" />
                          <asp:BoundField  DataField="factamount"  HeaderText="实收数量"  />
                          <asp:BoundField  DataField="unitprice"  HeaderText="实际单价"  />
                          <asp:BoundField  DataField="factmoney"  HeaderText="实际金额"  />
                          <asp:BoundField  DataField="memo"  HeaderText="备注"  />
                          <asp:BoundField  DataField="factmoney"  HeaderText="实际金额"  />
                          <asp:CommandField ButtonType=Button SelectText="选中"  ShowCancelButton=true ShowEditButton="true" ShowDeleteButton="true" CancelText="取消" UpdateText="更新" DeleteText="删除" EditText="编辑" />
                          </Columns>
                        </asp:GridView>
                        <asp:datagrid id="dg" runat="server" Width="100%" ShowFooter="True" AutoGenerateColumns="False"
                               OnDeleteCommand="dg_DeleteCommand"   OnUpdateCommand="dg_UpdateCommand"
                                OnItemDataBound="dg_ItemDataBound" OnCancelCommand="dg_CancelCommand"
								DataKeyField="thisid" oneditcommand="dg_EditCommand">
								<Columns>
									<asp:BoundColumn ReadOnly="True" HeaderText="序号"></asp:BoundColumn>
									<asp:BoundColumn DataField="number" ReadOnly="True" HeaderText="编号" FooterText="合计"></asp:BoundColumn>
									<asp:BoundColumn DataField="productname" ReadOnly="True" HeaderText="名称规格"></asp:BoundColumn>
									<asp:BoundColumn DataField="shouldamount" ReadOnly="True" HeaderText="应收数量"></asp:BoundColumn>
									<asp:BoundColumn DataField="factamount" HeaderText="实收数量"></asp:BoundColumn>
									<asp:BoundColumn DataField="unitprice" HeaderText="实际单价">
										<ItemStyle HorizontalAlign="Right"></ItemStyle>
									</asp:BoundColumn>
									<asp:BoundColumn DataField="factmoney" HeaderText="实际金额">
										<ItemStyle HorizontalAlign="Right"></ItemStyle>
									</asp:BoundColumn>
									<asp:BoundColumn DataField="memo" HeaderText="备注"></asp:BoundColumn>
									<asp:BoundColumn Visible="False" DataField="thisid"></asp:BoundColumn>
									<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="更新" CausesValidation=false  CancelText="取消" EditText="编辑"></asp:EditCommandColumn>
									<asp:ButtonColumn Text="&lt;span OnClick='return confirmdel();'&gt;删除&lt;/span&gt;" CommandName="Delete"></asp:ButtonColumn>
								</Columns>
							</asp:datagrid>
                            
                            
                            </TD>
					</TR>
				</TABLE>
			</FONT>
		</form>
		<script>
		    function changeMe() {
		        var price = parseFloat(Form1.tbfactunit.value);
		        Form1.tbfactMoney.value = Math.round(price * parseFloat(Form1.tbfactamount.value * 100)) / 100;

		    }
		</script>
	</body>
</HTML>